<?php
/*
===========================================================================

  Copyright (c) 2010-2012 DSPWeb Development Team

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see http://www.gnu.org/licenses/

  This file is part of DSPWeb source code

===========================================================================
*/

$output = '';

$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;

$output .= '
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<center>';
if (!empty($_SESSION['loggedin'])) {
$output .= '
<center>
<table cellpadding=0 cellspacing=0 style="width: 100%; border-left: 1px solid #c0c0c0; border-right: 1px solid #c0c0c0; border-bottom: 1px solid #c0c0c0; background-color: #F1F3F5;">
<tr>
<td style="text-align: center; width: 70px; font-size: 10px; padding: 5px; line-height: 20px;">&nbsp;</td>
<td style="text-align: right; padding-right: 5px; font-size: 10px; padding: 5px; line-height: 20px;">Welcome back, <a href="account.php" style="font-weight: bold;">'.$_SESSION['login'].'</a>! [<a href="logout.php">Logout</a>]</td>
</tr>
</table>';
}
$output .= '
<br />
<center>
<table id="surround" cellpadding=0 cellspacing=0 style="background-color: #fff;">
<tr>
<td height="50px" style="background: url(\'dsp_logo.png\'); text-align: right; padding-right: 5px; vertical-align: bottom; color: #fff; font-size: 10px">0.0.1 Beta</td>
</tr>
<tr>
<td height="10px"><img src="linebg.png"></td>';
if (!empty($_SESSION['loggedin'])) {
$output .= '
<tr>
<td height="30px">
	<table width="100%" border=0 class="nav" cellpadding=0 cellspacing=0>
	<tr>
		<td class="nav" width="100px"><a href="index.php">Home</a></td>
		<td class="nav" width="100px"><a href="characters.php">Characters</a></td>
		<td class="nav" width="100px"><a href="region.php">Region Info</a></td>
		<td class="nav" width="100px"><a href="account.php">Account</a></td>
		<td class="nav" width="400px" style="border-right: none;">&nbsp;</td>
	</tr>
	</table>
</td>
</tr>';
}
$output .= '
<tr>
<td>
<p>&nbsp;
</p><center>';
include($page);
$output .= '
</td>
</tr>
</table>';
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
$output .= '
<p>Website generated in '.$total_time.' seconds.<br/>DSPWeb Account Management System
</p>
</center>
</html>';
?>